import Base from './Base'

class Wechat extends Base {
  constructor ({
    id = ''
  }) {
    super({id})
  }
  // Ouath验证跳转
  static getOauth (path) {
    window.location.href = `${window.location.origin}/fund-mp-api${Wechat.$name}/oauth/${path}`
  }
  // 获取页面签名
  static async getSign (params) {
    let res = await Wechat.$http.get(`${Wechat.$name}/jssdk/sign`, {params})
    return res
  }
  // 是否已登录过注册用户
  static async hasUser (params) {
    let res = await Wechat.$http.get(`${Wechat.$name}/jssdk/sign`, {params})
    return res
  }
}
// static attr
Wechat.$name = '/weixin'
export default Wechat
